Electronic devices including a plurality of rechargeable batteries (hereinafter referred to simply as batteries) have been developed. As an example of one of these electronic devices, there is a detachable computer including a tablet computer with a detachable keyboard which allows the computer to be used as a notebook computer or a tablet computer. The tablet includes a battery (hereinafter referred to as a main battery) by which it is powered. In order to increase the battery life of the tablet when it is attached to the keyboard, a battery (hereinafter referred to as a second battery) is also provided in the keyboard, and the tablet is powered by the main battery and the auxiliary battery when being used as a notebook computer.
In a case where both the keyboard and the tablet are connectable to an AC adapter, the second battery and the main battery are charged from the AC adapter. In a case where the keyboard is connectable to an AC adapter but the tablet is not connectable to an AC adapter, the main battery is charged from the AC adapter connected to the keyboard when the tablet is attached to the keyboard.
There has been demand, in a case where there is neither an AC adapter nor AC power available, for a technique of charging the main battery by using the power from the second battery. In battery charging in general, it is necessary to control a charging current and a charging voltage properly. However, there has been no appropriate charging control method for charging one battery by using the power of another.